package com.iw.adoms.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.iw.core.orm.hibernate.BaseEntity;

@Entity
@Table(name = "order_line")
public class OrderLine extends BaseEntity {

	private Double totalPrice; // 总价
	private Integer orderNum; // 订单商品数量

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "marchandise_id")
	private Marchandise marchandise;// 订购商品

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_id")
	private Order order;// 订购商品
	private double boxNum;// 整件数
	private Integer items;// 零散数
	private Integer hasIn = 0;
	private Integer hasleft = 0;

	// mPrice=12.0&totalPrice=13332&orderNum=1111

	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Integer getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public Marchandise getMarchandise() {
		return marchandise;
	}

	public void setMarchandise(Marchandise marchandise) {
		this.marchandise = marchandise;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Integer getItems() {
		return items;
	}

	public void setItems(Integer items) {
		this.items = items;
	}

	public double getBoxNum() {
		return boxNum;
	}

	public void setBoxNum(double boxNum) {
		this.boxNum = boxNum;
	}

	public Integer getHasIn() {
		return hasIn == null ? 0 : hasIn;
	}

	public void setHasIn(Integer hasIn) {
		this.hasIn = hasIn;
	}

	public Integer getHasleft() {
		return hasleft == null ? 0 : hasleft;
	}

	public void setHasleft(Integer hasleft) {
		this.hasleft = hasleft;
	}

}